﻿#include "Game.h"

#include "_Global/Socket/ClientSocket.h"



//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

Game::Game(QObject *parent)
    :GameModel(parent)
{
    m_pGameModel = this;
}


void Game::SendDataToServer(QByteArray& data, quint8 outControlbyte)
{
    //m_pGameSocket->send();

    if(m_pGameModel->gameStatus() == GameModel::Game_Status_Running
            || m_pGameModel->gameStatus() == GameModel::Game_Status_GameOver)
        emit s_SendDataToServer(data, outControlbyte);
}

void Game::sl_qml_DebugButton(int button, QVariant v)
{
    if(button == 1)
    {
    }
    else if(button == 2)
    {
        return;
    }
    else
    {
        qDebug() << "sl_qml_DebugButton:" << button << v;
    }
    return;
}


QObject* Game::socketInfo() const
{
    return m_pGameSocket;
}

